package chat;

import java.net.*;


public class PendingPeerNode
{
    private PendingPeerNode zNext = null;
    private Socket zSocket;
    private PeerInfo zPeerInfo;

    public PendingPeerNode( Socket pSocket , PeerInfo pInfo )
    {
        zSocket = pSocket;
        IllegalArgument.ifNull( "PeerInfo" , zPeerInfo = pInfo );
    }

    public PendingPeerNode newPendingPeer( Socket pSocket , PeerInfo pInfo )
    {
        PendingPeerNode retval = new PendingPeerNode( pSocket , pInfo );
        this.zNext = retval;
        return retval;
    }

    public PendingPeerNode advanceToNext()
    {
        PendingPeerNode retval = zNext;
        zNext = null;
        return retval;
    }

    public Socket getSocket()
    {
        return zSocket;
    }

    public PeerInfo getPeerInfo()
    {
        return zPeerInfo;
    }
}